package org.developerworks.lift.model

import _root_.net.liftweb.mapper._
import _root_.net.liftweb.util._

object Bid extends Bid with KeyedMetaMapper[Long, Bid]{
  override def dbTableName = "bids"
  override def fieldOrder = amount :: Nil    
  override def dbIndexes = Index(item) :: Index(user) :: super.dbIndexes
}
class Bid extends KeyedMapper[Long, Bid]{
  def getSingleton = Bid
  def primaryKeyField = id
  object id extends MappedLongIndex(this)
  object amount extends MappedLong(this)
  object item extends MappedLongForeignKey(this, Item)
  object user extends MappedLongForeignKey(this, User)

}